home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
graphic
/
iterat31.zip
/
FUNCTION.TXT
< prev
next >
Wrap
Text File
|
1993-11-17
|
50KB
|
967 lines
A few comments about the functions in Iterate!
══════════════════════════════════════════════════════════════════════════════
Function A. x=c*x+a*cos(y) y=d*y+b*sin(x+a*cos(y))
──────────────────────────────────────────────────────────────────────────────
This was a mistake. I was trying to make Function B. (If you study the two,
you'll see what happened.) It turned out to be a rather fortunate mistake,
though, as this function is more interesting than Function B. I used this
function in my composition "Chaotic Suite for Computer and Synthesizer".
Parameters
──────────
On this function, I usually set a=b and c=d=1. You can try a=b=1, then
gradually increase this value to a=b=2, a=b=2.5 and so on. You will see the
function gradually break up and become more chaotic.
You can also experiment with setting 'a' and 'b' to different values. This
gives an interesting effect.
If you change 'c' and 'd', you will probably want to keep them close to 1,
i.e., c=.99, d=1.
Function B. x=c*x+a*cos(y) y=d*y+b*sin(x)
──────────────────────────────────────────────────────────────────────────────
Close to Function A. In both Functions A and B you'll notice that the entire
plane is tiled over with repetitive figures. This is of course because of the
periodic nature of the trig functions.
Parameters
──────────
Try the same sorts of parameters as Function A.
Function C. x=cos(mu)*x-sin(mu)*(y-x²) y=sin(mu)*x+cos(mu)*(y-x²)
──────────────────────────────────────────────────────────────────────────────
This function is due to Henon (one of the first mathematicians to put much
study into the area we now call chaos theory). I found it in a fascinating
book by Ekeland. Unfortunately, I had to give the book back to the library,
and now I live 1000 miles away from the library, and I can't for the life of
me remember the title.
It is quite an interesting little book, though, if you can find it anywhere.
Ekeland discussed this function and had a graph of it. I tried to duplicate
the graph on my computer, and so Iterate! was born.
This function is area preserving, which simply means that if you take any
region and put it through the function, the resulting region has the same area
as the one you started with. Symbolically, you would say the for a region R
and a function F, the area of R = the area of F(R).
The fact that a function is area preserving has certain ramifications for the
physical interpretation of the function. For instance, imagine a planet
revolving around the sun. Imagine a plane which cuts through the planet's
orbit at right angles to the orbit. Imagine that each time the planet comes
around the sun, you mark the spot where its center of gravity passes through
the plane.
(If this explanation was too complicated for you, just think of making a dot
on the spot where the earth is at 12 midnight on December 31st. Make a new dot
every year on December 31st.)
What have we got? An iterated function, of course. You can think
of the planet as being the "function", and each orbit of the planet is one
iteration of the function, which produces one dot on the plane.
Now if the planet is the only planet in the whole universe, and if it happens
to be orbiting the sun in a perfectly circular orbit, we're going to have a
pretty darn boring graph. Each time the planet comes around, it's just going
to hit the very same spot again. So it is like a fixed point. It doesn't go
anywhere and it's not very exciting.
But let's suppose instead that there are a few other planets in our solar
system, and maybe our planet has a moon or two orbiting it. Now all of a
sudden our perfectly circular orbit isn't quite so circular any more. In
fact, our orbit is going to have quite a few interesting little perturbations
to it, and it definitely isn't going to hit the same spot on our plane each
time around. It is going to make a fascinating pattern of dots on the plane--
something, as a matter of fact, like what you'll see if you run Function C.
Because that's how Function C was made--imagining this kind of orbit, and how
it would hit the plane, and then just figuring out the equations for the dots,
so you don't have to think about all that gosh darned orbiting every time. In
fact, the parameter mu in this function is some kind of orbital incidence
parameter or something. Find Ekeland, ask him, and then we'll both know.
At any rate, back to area preserving. It turns out that any function that is
derived this way--by thinking about orbits hitting a plane and so on--has this
area preserving property. And (as I recall) the opposite is true, too--if you
have an area preserving function, then you can find an orbit that fits it
perfectly.
. . .
Here's another interesting point about this function. Try this function with
mu=77 degrees, and you will notice that it makes a fractal pattern (see
Iterate!.txt for more details). What happens is that there is a large central
circle with 5 smaller circles surrounding it. Each of the smaller circles
is surrounded by 5 even smaller circles. These even smaller circles are
surrounded by yet smaller circles, and so on ad infinitum.
(Actually, if you try this out, you will find that it is not always 5 circles
surrounding, but maybe 3,4,5,6, or whatever. But for the sake of simplicity,
let's just say it's 5 each time.)
Here's a little schematic of sort of what this looks like (this time with
4 "circles" surrounding each larger "circle"--but that's the limitations
of ASCII):
O O O O
┌─┐ ┌─┐
│ │ │ │
└─┘ └─┘
O O O O
┌────┐
│ │
│ │
│ │
└────┘
O O O O
┌─┐ ┌─┐
│ │ │ │
└─┘ └─┘
O O O O
Now here's the point: Let's suppose it takes 100 iterations to draw the
middle (largest) circle satisfactorily. Then it takes 5 times as many
iterations to draw the five surrounding circles to the same degree of
detail (if you try this function, you'll soon see why--it's because one
point draws the entire middle circle, and another point draws all five
surrounding circles, so it's spread 5 times as thin and requires 5 times
the iterations to look as good).
If we go down another level to the next smaller circles, you will again have
to 5 times the iterations to get the same degree of detail. So now we're to
5 x 5 x 100 iterations = 2500 iterations. Going down another level
multiplies by 5 again, and we have 12,500 iterations. Going to a fifth
level requires 5 x 12,500 = 62,500 iterations. For the sixth level,
5 x 62,500 = 312,500 iterations. For the seventh level,
5 x 312,500 = 1,562,500. Skipping a few levels (I assume you can
multiply by 5 on your own), we find the the 20th level requires about
2,000,000,000,000,000 iterations. (That's two quadrillion, just in case
your wondering. We know that this is a very, very, VERY large number,
because--at this writing--it